package com.j.thread;


import java.util.concurrent.Callable;

public class MyCallable implements Callable<Integer> {
    //这里可以传各种参数
    Integer id;

    //通过构成来传递参数
    public MyCallable(int id) {
        this.id = id;

    }
    @Override
    public Integer call() {
        return doSomething();
    }

    //这里是实现业务的各种方法
    public Integer doSomething() {
        System.out.println("i am a callable,doing something");
        return id;
    }
}
